// 类型定义
import request from '@/utils/request.ts'

const BASE_URL = "/api/v1/pdf";

export interface HotDocData {
  id: string
  name: string
  classifyId: string
  classifyName: string
  gradeId: string
  gradeName: string
  subjectId: string
  subjectName: string
  createTime: string
  grade: string
  authorName: string
  coin: number
  coverUrl: string
}

export interface LatestDocData {
  id: number
  title: string
  cover: string
  date: string
  views: number
}

export interface Activity {
  id: string
  operatorName: string
  operationTime: string
  fileName: string,
  fileId: string
}


export const getDocList= async ()=> {
  return request<any, DocData[]>({
    url: `${BASE_URL}/list`,
    method: 'get'
  })
}

export  const getPopularDocList= async ()=> {
  return request<any, HotDocData[]>({
    url: `${BASE_URL}/popular/list`,
    method: 'get'
  })
}

export  const getActivity= async ()=> {
  return request<any, Activity[]>({
    url: `${BASE_URL}/user/activity`,
    method: 'get'
  })
}
